class Singleton {
  //单例公开访问点
  factory Singleton() => _getInstance();

  //静态私有成员，未初始化，懒汉式单例
  static Singleton _instance;

  //私有构造函数
  Singleton._();

  static Singleton _getInstance() {
    if (_instance == null) {
      _instance = Singleton._();
    }
    return _instance;
  }
}
